/**
 *@auther: tang
 *@Date: 2021-02-23
 *Project: p2pPlatformSys
 *Lang: TypeScript
 */
import { Service } from 'egg';
import * as utils from '../utils/utils';

class LogsService extends Service {
  async add(params:any) {
    // return allBits;
    const { ctx } = this;
    params.num = params.num || utils.getDateNumber();
    const oriData:any = utils.clearObj((await ctx.model.Fnlogs.findAll({ limit: 1 }))[0].dataValues);
    const res:object[] = await ctx.model.Fnlogs.create(utils.generateObjArr(params, oriData));
    return res;
  }
}

export default LogsService;
